import request from '@/utils/request'
// 抽取出来方便后面使用
const apiUrl = '/admin/product/brand'

/**
 * 查询全部品牌
 * @returns {*}
 */
export const findAll =()=>{
    return request({
        url:`${apiUrl}/findAll`,
        method:'get',
    })
}

export const deleteBrandById=(id)=>{
    return request({
        url:`${apiUrl}/deleteBrandById/${id}`,
        method:'delete',
    })
}
/**
 * 分页查询
 * @param page
 * @param limit
 * @returns {*}
 */
export const getBrandByPage=(page,limit)=>{
    return request({
        url:`${apiUrl}/showByPage/${page}/${limit}`,
        method:'get',
    })
}
/**
 * 新增品牌
 * @param data
 * @returns {*}
 */
export const savaBrand=(data)=>{
    return request({
        url:`${apiUrl}/save`,
        method:'post',
        data
    })
}


//edit
/**
 * 修改品牌
 * @param data
 * @returns {*}
 */
export const editBrand=(data)=>{
    return request({
        url:`${apiUrl}/edit`,
        method:'put',
        data
    })
}
